<?php
// $Id: LogoutAction.class.php,v 1.2 2006/05/18 14:23:04 diegor Exp $
require_once(APP_LIB_DIR . 'LoginModel.class.php');
class LogoutAction extends Action
{
    function execute (&$controller, &$request, &$user)
    {
        global $config;
        $lm = new LoginModel('LogoutAction');

        $auth = $user->getAttribute('auth');
        $lm->logout($auth['id']);
        $user->setAuthenticated(FALSE);
        $user->clearAll();

        $controller->forward(DEFAULT_MODULE, DEFAULT_ACTION);
        return VIEW_NONE;
      }
}
?>
